home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  5.0 KB  |  186 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Monday, September 16, 1991 at 12:12 AM
  4.  Processes.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1989-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT Processes;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingProcesses}
  22. {$SETC UsingProcesses := 1}
  23.  
  24. {$I+}
  25. {$SETC ProcessesIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingEvents}
  31. {$I $$Shell(PInterfaces)Events.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingFiles}
  34. {$I $$Shell(PInterfaces)Files.p}
  35. {$ENDC}
  36. {$SETC UsingIncludes := ProcessesIncludes}
  37.  
  38. TYPE
  39. { type for unique process identifier }
  40. ProcessSerialNumberPtr = ^ProcessSerialNumber;
  41. ProcessSerialNumber = RECORD
  42.  highLongOfPSN: LONGINT;
  43.  lowLongOfPSN: LONGINT;
  44.  END;
  45.  
  46.  
  47. CONST
  48.  
  49. {************************************************************************
  50.  *                            Process identifier.
  51.  ************************************************************************
  52.  Various reserved process serial numbers. }
  53.  
  54. kNoProcess = 0;
  55. kSystemProcess = 1;
  56. kCurrentProcess = 2;
  57.  
  58. TYPE
  59. {*********************************************************************************************************************************************
  60.  *        Definition of the parameter block passed to _Launch.
  61.  *************************************************************************
  62.  
  63. * Typedef and flags for launchControlFlags field }
  64. LaunchFlags = INTEGER;
  65.  
  66. CONST
  67.  
  68. {************************************************************************
  69.  *        Definition of the parameter block passed to _Launch.
  70.  ************************************************************************}
  71.  
  72. launchContinue = $4000;
  73. launchNoFileFlags = $0800;
  74. launchUseMinimum = $0400;
  75. launchDontSwitch = $0200;
  76. launchAllow24Bit = $0100;
  77. launchInhibitDaemon = $0080;
  78.  
  79. TYPE
  80. { Format for first AppleEvent to pass to new process.  The size of the overall
  81.  * buffer variable: the message body immediately follows the messageLength.
  82.  }
  83. AppParametersPtr = ^AppParameters;
  84. AppParameters = RECORD
  85.  theMsgEvent: EventRecord;
  86.  eventRefCon: LONGINT;
  87.  messageLength: LONGINT;
  88.  messageBuffer: ARRAY [0..0] OF SignedByte;
  89.  END;
  90.  
  91. { Parameter block to _Launch }
  92. LaunchPBPtr = ^LaunchParamBlockRec;
  93. LaunchParamBlockRec = RECORD
  94.  reserved1: LONGINT;
  95.  reserved2: INTEGER;
  96.  launchBlockID: INTEGER;
  97.  launchEPBLength: LONGINT;
  98.  launchFileFlags: INTEGER;
  99.  launchControlFlags: LaunchFlags;
  100.  launchAppSpec: FSSpecPtr;
  101.  launchProcessSN: ProcessSerialNumber;
  102.  launchPreferredSize: LONGINT;
  103.  launchMinimumSize: LONGINT;
  104.  launchAvailableSize: LONGINT;
  105.  launchAppParameters: AppParametersPtr;
  106.  END;
  107.  
  108.  
  109. CONST
  110.  
  111. { Set launchBlockID to extendedBlock to specify that extensions exist.
  112. * Set launchEPBLength to extendedBlockLen for compatibility.}
  113.  
  114.  
  115.  
  116.  
  117. extendedBlock = $4C43;    { 'LC' }
  118. extendedBlockLen = (sizeof(LaunchParamBlockRec) - 12);
  119.  
  120. {************************************************************************
  121.  * Definition of the information block returned by GetProcessInformation
  122.  ************************************************************************
  123.  Bits in the processMode field }
  124.  
  125. modeDeskAccessory = $00020000;
  126. modeMultiLaunch = $00010000;
  127. modeNeedSuspendResume = $00004000;
  128. modeCanBackground = $00001000;
  129. modeDoesActivateOnFGSwitch = $00000800;
  130. modeOnlyBackground = $00000400;
  131. modeGetFrontClicks = $00000200;
  132. modeGetAppDiedMsg = $00000100;
  133. mode32BitCompatible = $00000080;
  134. modeHighLevelEventAware = $00000040;
  135. modeLocalAndRemoteHLEvents = $00000020;
  136. modeStationeryAware = $00000010;
  137. modeUseTextEditServices = $00000008;
  138.  
  139. TYPE
  140. { Record returned by GetProcessInformation }
  141. ProcessInfoRecPtr = ^ProcessInfoRec;
  142. ProcessInfoRec = RECORD
  143.  processInfoLength: LONGINT;
  144.  processName: StringPtr;
  145.  processNumber: ProcessSerialNumber;
  146.  processType: LONGINT;
  147.  processSignature: OSType;
  148.  processMode: LONGINT;
  149.  processLocation: Ptr;
  150.  processSize: LONGINT;
  151.  processFreeMem: LONGINT;
  152.  processLauncher: ProcessSerialNumber;
  153.  processLaunchDate: LONGINT;
  154.  processActiveTime: LONGINT;
  155.  processAppSpec: FSSpecPtr;
  156.  END;
  157.  
  158.  
  159. FUNCTION LaunchApplication(LaunchParams:LaunchPBPtr):OSErr;
  160.  INLINE $205F,$A9F2,$3E80;
  161. FUNCTION LaunchDeskAccessory(pFileSpec: FSSpecPtr;pDAName: StringPtr): OSErr;
  162.  INLINE $3F3C,$0036,$A88F;
  163. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  164.  INLINE $3F3C,$0037,$A88F;
  165. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  166.  INLINE $70FF,$2F00,$3F3C,$0039,$A88F;
  167. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  168.  INLINE $3F3C,$0038,$A88F;
  169. FUNCTION GetProcessInformation(PSN: ProcessSerialNumber;VAR info: ProcessInfoRec): OSErr;
  170.  INLINE $3F3C,$003A,$A88F;
  171. FUNCTION SetFrontProcess(PSN: ProcessSerialNumber): OSErr;
  172.  INLINE $3F3C,$003B,$A88F;
  173. FUNCTION WakeUpProcess(PSN: ProcessSerialNumber): OSErr;
  174.  INLINE $3F3C,$003C,$A88F;
  175. FUNCTION SameProcess(PSN1: ProcessSerialNumber;PSN2: ProcessSerialNumber;
  176.  VAR result: BOOLEAN): OSErr;
  177.  INLINE $3F3C,$003D,$A88F;
  178.  
  179.  
  180. {$ENDC} { UsingProcesses }
  181.  
  182. {$IFC NOT UsingIncludes}
  183.  END.
  184. {$ENDC}
  185.  
  186.